package com.atguigu.gulimall.product.entity;

import com.atguigu.common.valid.AddGroup;
import com.atguigu.common.valid.UpdateGroup;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import lombok.Data;

import javax.validation.constraints.*;

/**
 * @author zhuanning
 * @email zhuanning@gmail.com
 * @date 2020-05-22 23:55:35
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 更新id非空 新增id必须为空校验 分组
	 */
	@NotNull(groups = UpdateGroup.class)
	@Null(groups = AddGroup.class)
	@TableId
	private Long brandId;

	@NotBlank(message = "品牌名称不能为空")
	private String name;

	/**图片地址*/
	private String logo;

	private String descript;
	/**
	 * ??ʾ״̬[0-????ʾ??1-??ʾ]
	 */
	private Integer showStatus;

	/**检索字母*/
	@Pattern(regexp = "/^[a-zA-Z]$/",message = "首字母必须是一个字母")
	private String firstLetter;

	@NotEmpty
	@Min(value = 0,message = "排序必须大于等于等于0")
	private Integer sort;

}
